import request from '@/config/axios'

// 样本分类 VO
export interface JkProductTypeVO {
  id: number // id
  name: string // 分类名称
  status: number // 启用状态
}

// 样本分类 API
export const JkProductTypeApi = {
  // 查询样本分类分页
  getJkProductTypePage: async (params: any) => {
    return await request.get({ url: `/jikong/jk-product-type/page`, params })
  },

  // 查询样本分类精简列表
  getJkProductTypeSimpleList: async () => {
    return await request.get({ url: `/jikong/jk-product-type/simple-list` })
  },

  // 查询样本分类详情
  getJkProductType: async (id: number) => {
    return await request.get({ url: `/jikong/jk-product-type/get?id=` + id })
  },

  // 新增样本分类
  createJkProductType: async (data: JkProductTypeVO) => {
    return await request.post({ url: `/jikong/jk-product-type/create`, data })
  },

  // 修改样本分类
  updateJkProductType: async (data: JkProductTypeVO) => {
    return await request.put({ url: `/jikong/jk-product-type/update`, data })
  },

  // 删除样本分类
  deleteJkProductType: async (id: number) => {
    return await request.delete({ url: `/jikong/jk-product-type/delete?id=` + id })
  },

  // 导出样本分类 Excel
  exportJkProductType: async (params) => {
    return await request.download({ url: `/jikong/jk-product-type/export-excel`, params })
  }
}
